﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace JmShared
{
    /// <summary>
    /// Holds all user specific base settings for all jive clients.
    /// </summary>


    public abstract class UserSettings
    {
        [UserInfoAttribute(UserInfoAttributeType.FontFamily)]
        [UserSettingsType(UserSettingsType.BaseSettings)]

        public string FontFamily { get; set; }

        [UserInfoAttribute(UserInfoAttributeType.FontColor)]
        [UserSettingsType(UserSettingsType.BaseSettings)]

        public string FontHexColor { get; set; }

        [UserInfoAttribute(UserInfoAttributeType.FontStyle)]
        [UserSettingsType(UserSettingsType.BaseSettings)]

        public string FontStyle { get; set; }

        [UserInfoAttribute(UserInfoAttributeType.FontWeight)]
        [UserSettingsType(UserSettingsType.BaseSettings)]

        public string FontWeight { get; set; }

        [UserSettingsType(UserSettingsType.BaseSettings)]

        public double? FontSize { get; set; }

        [UserSettingsType(UserSettingsType.BaseSettings)]

        public bool? EnableNudge { get; set; }

        [UserSettingsType(UserSettingsType.BaseSettings)]

        public bool? ShowTimestamp { get; set; }

        [UserSettingsType(UserSettingsType.BaseSettings)]

        public bool? StoreMessagesWhileOffline { get; set; }

        [UserSettingsType(UserSettingsType.BaseSettings)]

        public int? OfflineMessagesCountLimit { get; set; }

        [UserSettingsType(UserSettingsType.BaseSettings)]

        public int? OfflineMessagesAgeLimit { get; set; }

        [UserSettingsType(UserSettingsType.BaseSettings)]

        public bool? ReceiveAnsweredMessagesWhileOffline { get; set; }

        [UserInfoAttribute(UserInfoAttributeType.Nickname)]
        [UserSettingsType(UserSettingsType.BaseSettings)]

        public string NickName { get; set; }

        [UserInfoAttribute(UserInfoAttributeType.Avatar)]
        [UserSettingsType(UserSettingsType.BaseSettings)]
        public Avatar Avatar { get; set; }
        //public string AvatarHash { get; set; }
        //public byte[] Avatar { get; set; }
        /// <summary>
        /// Key is emoticon shortcut, value is image file name
        /// </summary>
        [UserInfoAttribute(UserInfoAttributeType.CustomEmoticons)]
        [UserSettingsType(UserSettingsType.BaseSettings)]

        public HashSet<ContactEmoticon> CustomEmoticons { get; set; }
        /// <summary>
        /// List of usernames of ignored contacts
        /// </summary>
        [UserSettingsType(UserSettingsType.BaseSettings)]

        public List<string> IgnoredContacts { get; set; }
        /// <summary>
        /// List of group ID's of blocked groups
        /// </summary>
        [UserSettingsType(UserSettingsType.BaseSettings)]

        public IList<string> BlockedGroups { get; set; }

        [UserSettingsType(UserSettingsType.BaseSettings)]

        public bool? AnimateGifEmoticons { get; set; }

        [UserSettingsType(UserSettingsType.BaseSettings)]

        public ClientStatus? ManualClientStatus { get; set; }

        /// <summary>
        /// List of group ID's of open groups
        /// </summary>
        [UserSettingsType(UserSettingsType.BaseSettings)]

        public IList<OpenChat> OpenChats { get; set; }

    }


    [AttributeUsage(AttributeTargets.Property)]
    public class UserInfoAttribute : Attribute
    {
        public UserInfoAttributeType PropertyType { get; set; }
        public UserInfoAttribute(UserInfoAttributeType type)
        {
            PropertyType = type;
        }
    }

    [AttributeUsage(AttributeTargets.Property)]
    public class UserSettingsTypeAttribute : Attribute
    {
        public UserSettingsType Settingstype { get; set; }
        public UserSettingsTypeAttribute(UserSettingsType type)
        {
            Settingstype = type;
        }
    }
}
